<script>
layui.use(['layer', 'jquery'], function () { //独立版的layer无需执行这一句
        var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
        var submit_box;
        $('#submit-code').click(function () {
			console.log("submit button click");
            var dis=$(this).attr("disabled"); 
            var $thebtn=$(this);
            console.log(dis);
            if(dis==='disabled') {
                return ;
            }
            $(this).attr("disabled","disabled"); 
            var cid = $(this).attr('nyoj-cid');
            var pid = $(this).attr('nyoj-pid');
            //alert(cid+" "+pid);
            $.ajax({
                url: '/api/submitpage-' + pid + '-' + cid,
                type: "GET",
                success: function (res) {
                    htmls = res.html;
					console.log("submit button click,get");
                    submit_box=layer.open({
                        type: 1,
                        title: '代码提交',
                        area: ['60%', '80%'],
                        content: htmls,
                        shadeClose:true,
                        end:function(){
                            $thebtn.attr("disabled",null);
                        }
                    });
                }
            });
        });
//        layer.close(submit_box,)
    });
</script>